<template>
  <div class="vita-cell vita-cell-switch">
    <div class="vita-cell-hd vita-cell-primary">
      <label class="vita-label">{{title}}</label>
    </div>
    <div class="vita-cell-ft">
      <input type="checkbox" class="vita-switch" :disabled="disabled" v-model="value">
    </div>
  </div>
</template>

<script>
  
  export default {
    props: {
      title: {
        type: String,
        required: true
      },
      disabled: {
        type: Boolean,
        default: false
      },
      value: {
        type: Boolean,
        twoWay: true
      }
    },

    watch: {
      value(newVal)  {
        this.$dispatch('change', newVal)
      }
    }
  }

</script>